home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 7: Sunsite / Linux Cubed Series 7 - Sunsite Vol 1.iso / system / admin / sudo-1.000 / sudo-1 / sudo-1.2 / Makefile < prev    next >
Makefile  |  1995-03-08  |  6KB  |  173 lines

  1. #*
  2. #*  sudo version 1.1 allows users to execute commands as root
  3. #*  Copyright (C) 1991  The Root Group, Inc.
  4. #*
  5. #*  This program is free software; you can redistribute it and/or modify
  6. #*  it under the terms of the GNU General Public License as published by
  7. #*  the Free Software Foundation; either version 1, or (at your option)
  8. #*  any later version.
  9. #*
  10. #*  This program is distributed in the hope that it will be useful,
  11. #*  but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. #*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  13. #*  GNU General Public License for more details.
  14. #*
  15. #*  You should have received a copy of the GNU General Public License
  16. #*  along with this program; if not, write to the Free Software
  17. #*  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  18. #*
  19. #*  If you make modifications to the source, we would be happy to have
  20. #*  them to include in future releases.  Feel free to send them to:
  21. #*      Jeff Nieusma                       nieusma@rootgroup.com
  22. #*      3959 Arbol CT                      (303) 447-8093
  23. #*      Boulder, CO 80301-1752             
  24. #*
  25. #
  26. #   This is the Makefile for the main level of sudo
  27. #
  28. #
  29. #          The following macros can be defined when compiling
  30. #
  31. #          FQDN                   - if you have fully qualified hostnames
  32. #                                   in your SUDOERS files
  33. #
  34. #          SYSLOG                 - if you want to use syslog instead
  35. #                                   of a log file
  36. #                                   ( This is a nice feature.  You can
  37. #                                     collect all your sudo logs at a
  38. #                                     single host)
  39. #
  40. #          NO_ROOT_SUDO           - sudo will exit if called by root
  41. #          MULTIMAX               - define if installing on Encore Multimax
  42. #                                   Also change the LIBS macro to "LIBS=-ll"
  43. #
  44. #          SEND_MAIL_WHEN_NOT_OK  - if you want a message sent to ALERTMAIL
  45. #                                   when the user is in the SUDOERS but
  46. #                                   does not have permission to execute
  47. #                                   the command entered
  48. #                                   ( This can be used at paranoid sites )
  49. #
  50. #          SEND_MAIL_WHEN_NO_USER - if you want a message sent to ALERTMAIL
  51. #                                   when the user is not in the SUDOERS file
  52. #                                   ( This is generally the case )
  53. #
  54. #          TIMEDIR                  the directory where the timestamp 
  55. #                                   files are kept.
  56. #
  57. #          TIMEOUT                  the number of minutes that can elapse
  58. #                                   before sudo will ask for a passwd again
  59. #
  60. #          TRIES_FOR_PASSWORD       the number of times sudo will let you
  61. #                                   guess are you password before screaming
  62. #
  63. #          INCORRECT_PASSWORD       the message that is displayed if you 
  64. #                                   incorrectly enter your password
  65. #
  66. #          MAILSUBJECT              the subject of the mail sent to ALERTMAIL
  67. #
  68. #          ALERTMAIL                the recipient of mail from sudo
  69. #
  70. #          SUDOERS                  the location of the sudoers file
  71. #
  72. #          TMPSUDOERS               the location of the lock file for visudo
  73. #
  74. #          EDITOR                   the location of the editor
  75. #
  76. #          LOGFILE                  log file location IF NOT USING SYSLOG
  77. #
  78. #          SYSLOG                   if this variable is defined, sudo will log
  79. #                                   using the 4.3 BSD style syslog facility
  80. #
  81. #       Macro:                   Default:
  82. #          Syslog_ident             "sudo"
  83. #          Syslog_options           LOG_PID
  84. #          Syslog_facility          LOG_LOCAL2
  85. #          Syslog_priority_OK       LOG_NOTICE
  86. #          Syslog_priority_NO       LOG_ALERT
  87. #
  88.  
  89. # define this for shadow passwords
  90.     SHADOW = -DSHADOW_PWD
  91.         CC = gcc
  92.        LEX = flex
  93.       YACC = bison -y
  94.    CCFLAGS = -O2 -DHAVE_STRDUP -DLINUX $(SHADOW) -m486 -fomit-frame-pointer
  95.    LDFLAGS = -s
  96. # use this for debugging
  97. #   CCFLAGS = -g -DHAVE_STRDUP -DLINUX $(SHADOW)
  98.    LDFLAGS = 
  99.    DEFINES = -LOGFILE=/var/adm/sudo
  100.       OBJS = find_path.o logging.o sudo.o check.o parse.o lex.yy.o y.tab.o
  101.       SRCS = find_path.c logging.c sudo.c check.c parse.c
  102.   INCLUDES = sudo.h
  103.    SUDOBIN = sudo.bin
  104.    SUDODIR = /usr/bin
  105.  VISUDODIR = /usr/sbin
  106. SUDOERSDIR = /etc
  107. MANSECTION = 8
  108.     MANDIR = /usr/man/man${MANSECTION}
  109.       PROG = sudo.bin
  110.       LIBS = -lfl -lshadow
  111.     SUNOS4 = -Bstatic
  112.      LINUX = 
  113.  
  114.  
  115. .SUFFIXES:    .o .c
  116.  
  117. .c.o:    ${SRCS}
  118.     ${CC} ${CCFLAGS} -c ${DEFINES} $<
  119.  
  120. all        :    ${PROG} visudo
  121.  
  122. all-sunos4    :    sudo-sunos4 visudo
  123.  
  124. ${PROG}        :    ${OBJS} 
  125.     ${CC} -o $@ *.o ${LIBS}
  126.  
  127. sudo-sunos4    :    ${OBJS}
  128.     ${CC} -o sudo *.o ${SUNOS4} ${LIBS}
  129.  
  130. y.tab.o    y.tab.h    :    parse.yacc ${INCLUDES}
  131.     ${YACC} -d parse.yacc
  132.     ${CC} $(CCFLAGS) -c y.tab.c
  133.  
  134. lex.yy.o    :    parse.lex y.tab.h ${INCLUDES}
  135.     ${LEX} parse.lex
  136.     ${CC} $(CCFLAGS) -c lex.yy.c
  137.  
  138. logging.o sudo.o check.o parse.o : ${INCLUDES}
  139.  
  140. visudo        :
  141.     (cd visudoers && make ${MFLAGS} $@)
  142.  
  143. install : install-all
  144.  
  145. install-all    : install-binaries install-sudoers install-man
  146.  
  147. install-all-sunos4: install-binaries-sunos4 install-sudoers
  148.  
  149. install-sudoers:
  150.     install -o root -g root -m 0600 -c sudoers ${SUDOERSDIR}/sudoers
  151.  
  152. install-binaries:    all
  153.     install -o root -g bin -m 4711 -s -c ${PROG} ${SUDODIR}/${SUDOBIN}
  154.     install -o root -g bin -m 0755 -c sudo.sh ${SUDODIR}/sudo
  155.     install -o root -g bin -m 0755 -s -c visudoers/visudo ${VISUDODIR}/visudo
  156.  
  157. install-binaries-sunos4:    sudo-sunos4 visudo
  158.     install -o root -g wheel -m 4111 -s -c sudo ${SUDODIR}/sudo
  159.     install -o root -g wheel -m 0111 -s -c visudoers/visudo ${VISUDODIR}/visudo
  160.  
  161. install-man:
  162.     install -o root -g man -m 0444 -c sudo.8 ${MANDIR}/sudo.${MANSECTION}
  163.     ( cd /usr/man/man8 ; \
  164.       ln -fs sudo.8 visudo.8 ; chown root.man visudo.8 )
  165.  
  166. tags        :
  167.     ctags ${SRCS} ${INCLUDES}
  168.  
  169. clean        :
  170.     -rm -f lex.yy.* y.tab.* *.o ${PROG}
  171.     (cd visudoers && make ${MFLAGS} $@);
  172.